package com.frxuexi.lib_base.room

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update

@Dao
interface UserDao {
    /**
     * 注册
     */
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun registerUser(user: User):Long

    @Query("select * from user_info where uname= :name and upass = :pass")
    fun login(name:String,pass:String):User?

    @Delete
    fun deleteUser(user: User)

    @Update
    fun updateUser(user: User)

}